package com.zyg.jas.common.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class Article implements Serializable {
    private Integer aId; //文章的id
    private String aName; //发布人的名字
    private String aContent; //发布内容
    private String userId;//发布人的唯一标志id
    private String title;//文章标题
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")//后台的时间 格式化 发送到前台
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//接受前台的时间格式 传到后台的格式
    private Date publishData; //发布时间

    public Article(){

    }
    public Article(Integer aId, String aName,String userId, String title,Date publishData , String aContent) {
        this.aId = aId;
        this.aName = aName;
        this.userId = userId;
        this.title = title;
        this.publishData = publishData;
        this.aContent = aContent;

    }
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
//        this.userId = userId;
        this.userId = userId == null ? null : userId.trim();
    }



    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public Integer getaId() {
        return aId;
    }

    public void setaId(Integer AId) {
        this.aId = AId;
    }

    public String getaName() {
        return aName;
    }

    public void setaName(String AName) {
        this.aName = AName;
    }

    public Date getPublishData() {
        return publishData;
    }

    public void setPublishData(Date publishData) {
        this.publishData = publishData;
    }

    public String getaContent() {
        return aContent;
    }

    public void setaContent(String aContent) {
        this.aContent = aContent;
    }
}
